FROM python:3.13-slim

WORKDIR /root
COPY . .
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip install jupyter
RUN jupyter notebook --generate-config

RUN cat <<EOF > /root/.jupyter/jupyter_notebook_config.py
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 6006
c.NotebookApp.allow_remote_access = True
c.NotebookApp.allow_root = True
c.NotebookApp.notebook_dir = '/root/workspace'
c.NotebookApp.token = 'lege'
EOF

RUN #mv jupyter_notebook_config.py  /root/.jupyter/jupyter_notebook_config.py
EXPOSE 6006

# 设置时区为东八区
ENV TZ=Asia/Shanghai
RUN ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
WORKDIR /root/workspace
CMD ["jupyter notebook --ip=0.0.0.0 --allow-root --port=6006 --no-browser"]